Skip to content

feat: optional instant_analysis for interactive resource previews#409

Draft
bolinocroustibat wants to merge 5 commits intomainfrom
feat/386-instant-analysis-flag
Draft

feat: optional instant_analysis for interactive resource previews#409
bolinocroustibat wants to merge 5 commits intomainfrom
feat/386-instant-analysis-flag

Conversation

@bolinocroustibat
Copy link
Copy Markdown
Contributor

@bolinocroustibat bolinocroustibat commented Apr 3, 2026

Closes #386

This adds an optional, backward-compatible instant_analysis boolean on the resource POST payload.

When true, Hydra persists it on catalog, prefers those rows in batch ordering, enqueues crawl/analysis on the high queue, and clears the flag with priority after preprocess—matching the existing create_check path without promoting every webhook update.

When udata sets instant_analysis on resource create/update, Hydra stores
it on catalog, orders batch selection ahead of other priority rows, and
uses the high RQ tier for crawl/analysis. Cleared after preprocess like
priority. Backward compatible (default false, unknown JSON keys ignored).

Closes #386

Made-with: Cursor
@bolinocroustibat bolinocroustibat self-assigned this Apr 3, 2026
Schedule check_resource after POST /api/resources when instant_analysis
is true; document udata coordination and CLI in README (#386).

Made-with: Cursor
@bolinocroustibat bolinocroustibat force-pushed the feat/386-instant-analysis-flag branch from 0ac6cd8 to fc18df6 Compare April 3, 2026 16:59
@bolinocroustibat bolinocroustibat changed the title feat(webhook): optional instant_analysis for interactive resource previews feat: optional instant_analysis for interactive resource previews Apr 3, 2026
@bolinocroustibat bolinocroustibat added the enhancement New feature or request label Apr 3, 2026
Comment thread udata_hydra/routes/resources.py Outdated
Comment thread udata_hydra/routes/resources.py Outdated

try:
resource = await Resource.get(resource_id)
if resource is None or resource["status"] is not None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to lock the ressource in the immediate check too? The crawler could pick up the ressource during the immediate check run, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! c321609

Comment thread udata_hydra/routes/resources.py Outdated
@Pierlou
Copy link
Copy Markdown
Contributor

Pierlou commented Apr 7, 2026

Not sure what we prefer between this and #348

@bolinocroustibat
Copy link
Copy Markdown
Contributor Author

bolinocroustibat commented Apr 8, 2026

Not sure what we prefer between this and #348

Oh I forgot about that, indeed

Avoid batch selecting the same resource while instant_analysis runs.
Clear stuck CRAWLING_URL if check_resource fails unexpectedly.

Made-with: Cursor
@maudetes maudetes marked this pull request as draft April 13, 2026 09:56
@maudetes
Copy link
Copy Markdown
Contributor

I think we should discuss our ideal approach before merging this indeed. I'm turning this into draft for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[hydra] Instant analysis of a ressource when user add a ressource manually, whatever the queue status

4 participants